package ai.people.netmon.framework.domain.telegram.entity;

import ai.people.netmon.framework.typehandler.MyLocalDateTimeTypeHandler;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.time.LocalDateTime;

/**
 * 用户分析表
 *
 * @author yuanqinglong
 * @date 2022/1/17 15:25
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
@TableName(value = "analysis_data_user", schema = "webservice")
public class AnalysisDataUser {

    public AnalysisDataUser(String analysisTargetId, String analysisTargetName) {
        this.analysisTargetId = analysisTargetId;
        this.analysisTargetName = analysisTargetName;
    }

    public AnalysisDataUser(String analysisTargetId, String analysisTargetName,String analysisSource,Integer analysisType) {
        this.analysisTargetId = analysisTargetId;
        this.analysisTargetName = analysisTargetName;
        this.analysisSource = analysisSource;
        this.analysisType = analysisType;
    }

    public AnalysisDataUser(Long userId,String analysisTargetId, String analysisTargetName,String analysisSource,Integer analysisType) {
        this.userId = userId;
        this.analysisTargetId = analysisTargetId;
        this.analysisTargetName = analysisTargetName;
        this.analysisSource = analysisSource;
        this.analysisType = analysisType;
    }

    @TableId
    private Long id;

    /**
     * 用户id
     */
    @TableField("user_id")
    private Long userId;
    /**
     * 分析类型
     */
    @TableField("analysis_type")
    private Integer analysisType;
    /**
     * 分析目标id
     */
    @TableField("analysis_target_id")
    private String analysisTargetId;

    /**
     * 分析目标名字
     */
    @TableField("analysis_target_name")
    private String analysisTargetName;

    /**
     * 分析源
     */
    @TableField("analysis_source")
    private String analysisSource;

    /**
     * 创建日期
     */
    @TableField(value ="create_date", typeHandler = MyLocalDateTimeTypeHandler.class)
    private LocalDateTime createDate;

    /**
     * 头像背景色值 例:#EE7AAE
     */
    @TableField("avatar_background")
    private String avatarBackground;

    /**
     * 头像url
     */
    @TableField("avatar_url")
    private String avatarUrl;

    /**
     * 最后修改日期
     */
    @TableField(value = "lastmodify_date", typeHandler = MyLocalDateTimeTypeHandler.class)
    private LocalDateTime lastmodifyDate;

    /**
     * 重点目标最后修改时间
     */
    @TableField(value = "import_target_lastmodify_date", typeHandler = MyLocalDateTimeTypeHandler.class)
    private LocalDateTime importTargetLastmodifyDate;

    /**
     * 重点目标（1：缓存中、0：未缓存）
     */
    @TableField("is_run_import_target")
    private Short isRunImportTarget;

    /**
     * 信息（1：缓存中、0：未缓存）
     */
    @TableField("is_run_net_msg")
    private Short isRunNetMsg;


}